unit ODEIntegrator;

interface
uses Helper;

type
  PAddValue = Procedure(t: extended; y: Vector) of object;
  PF = Procedure(t: extended; y: Vector; var dx : Vector) of object;

  TODEIntegrator = class
  public
  AddValue : PAddValue;
  F : PF;
  ProblemSize : integer;
  InitialConditions : vector;

  protected
  tol : extended;
  h : extended;
  initialStep : extended;
  TimeStart : extended;
  TimeEnd : extended;
  PositionInDense : integer;
  Stop : boolean;
  DensePoints : Vector;

  public
    constructor Create( tolerance : extended; step : extended;
                        timeStart : extended; timeEnd : extended;
                        densePoints : Vector);
    procedure Run; virtual; abstract;
  end;

implementation

  constructor TODEIntegrator.Create(tolerance : extended; step : extended;
                      timeStart : extended; timeEnd : extended;
                      densePoints : Vector);
  begin
    self.DensePoints := densePoints;
    self.tol :=  tolerance;
    self.h := step;
    self.TimeStart := timeStart;
    self.TimeEnd := timeEnd;
    self.initialStep := 0;
  end;
end.
